#!/sbin/openrc-run

extra_started_commands="reload"

: ${user:="backuppc"}
: ${logdir:="/var/log/BackupPC"}
: ${command_args:="-d"}

command="/usr/share/BackupPC/bin/BackupPC"
start_stop_daemon_args="--interpreted --user $user"
pidfile="/run/BackupPC/BackupPC.pid"
retry="30"

depend() {
	after firewall modules
}

start_pre() {
	checkpath -d -o $user -m 755 "${pidfile%/*}"
}

reload() {
	ebegin "Reloading $name"
	start-stop-daemon --signal 1 --pidfile "$pidfile" -x /usr/bin/perl
	eend $?
}
